package com.ghh.app.monsterrush.monsters;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.ghh.app.monsterrush.MonsterActor;
import com.ghh.app.monsterrush.MonsterRushGame;
import com.ghh.app.monsterrush.StateAction;
import com.ghh.app.monsterrush.monsters.state.AttackedState;
import com.ghh.app.monsterrush.monsters.state.DestroyState;
import com.ghh.app.monsterrush.monsters.state.WalkingState;

public class NerdZombie extends MonsterActor {
	private final static float	WIDTH		= 118f;
	private final static float	HEIGHT		= 118f;
	private final static int	basic_life	= 80;
	private final static float	basic_speed	= -80f;

	private Texture				texture;

	public NerdZombie(MonsterRushGame game) {
		super(game, basic_life, basic_speed);
		this.setSize(WIDTH, HEIGHT);
	}

	private Texture getTexture() {
		if (texture == null) {
			Texture.setEnforcePotImages(false);
			texture = new Texture(Gdx.files.internal("zombie2.png"));
		}
		return texture;
	}

	@Override
	protected StateAction createWalkState() {
		return new WalkingState(this, getTexture());
	}

	@Override
	protected StateAction createAttackedState() {
		return new AttackedState(this, getTexture(), 0.5f);
	}

	@Override
	protected StateAction createDestroyState() {
		return new DestroyState(this, getTexture());
	}

	@Override
	public void dispose() {
		texture.dispose();
	}
}
